$(function  () {

    //cookie数据赋值
    var id = $.cookie("cid");
    var name = $.cookie("cname");
    $("#name").val(name);

    layui.use('form', function(){
        var form = layui.form();
        //监听提交
        form.on('submit(edit)', function(data){
              var name1 = $("#name").val();

              $.ajax({
                url: ipurl+'/bclass/update',
                data: {
                    ID:id,
                    name: name1,
                },
                type: "POST",
                //dataType: "json",
                complete: function(data) {
                }
            });
            x_admin_close();
            top.location.reload();
          });
    });

})
